---
id: 65823e87c9741750a22085a7
title: ステップ 19
challengeType: 20
dashedName: step-19
---

# --description--

Next, define a function named `filter_expenses_by_category` that takes two parameters: `expenses` and `category`. Use `pass` to fill the function body.

# --hints--

You should define a function named `filter_expenses_by_category`.

```js
({ test: () => assert(__pyodide.runPython(`
    import inspect    
    inspect.isfunction(filter_expenses_by_category)
  `))
})
```

Your `filter_expenses_by_category` function should take `expenses` and `category` as the parameters.

```js
({ test: () => assert(__pyodide.runPython(`
    import inspect    
    sig = str(inspect.signature(filter_expenses_by_category))
    sig == '(expenses, category)'
  `))
})
```

# --seed--

## --seed-contents--

```py
def add_expense(expenses, amount, category):
    expenses.append({'amount': amount, 'category': category})

def print_expenses(expenses):
    for expense in expenses:
        print(f'Amount: {expense["amount"]}, Category: {expense["category"]}')

def total_expenses(expenses):
    return sum(map(lambda expense: expense['amount'], expenses))

--fcc-editable-region--

--fcc-editable-region--

expenses = []
```
